From e6a511848ab311c50b591d73d4df6440551392ce Mon Sep 17 00:00:00 2001 From: Domas Mituzas Date: Tue, 3 Jan 2006 10:31:13 +0000 Subject: [PATCH] allow pre-started Profiler --- includes/ProfilerSimple.php | 2 ++ includes/Setup.php | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/includes/ProfilerSimple.php b/includes/ProfilerSimple.php index 9269df592d..d96a755b32 100755 --- a/includes/ProfilerSimple.php +++ b/includes/ProfilerSimple.php @@ -8,6 +8,8 @@ * @todo document * @package MediaWiki */ +require_once('Profiling.php'); + class ProfilerSimple extends Profiler { function ProfilerSimple() { global $wgRequestTime,$wgRUstart; diff --git a/includes/Setup.php b/includes/Setup.php index 1fdc3f82ad..75f830f927 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -24,8 +24,11 @@ if ( !isset( $wgVersion ) ) { if( !isset( $wgProfiling ) ) $wgProfiling = false; -if ( $wgProfiling and (0 == rand() % $wgProfileSampleRate ) ) { +if ( is_object($wgProfiler) ) { + /* nada, everything should be done already */ +} elseif ( $wgProfiling and (0 == rand() % $wgProfileSampleRate ) ) { require_once( 'Profiling.php' ); + $wgProfiling = true; if ($wgProfilerType == "") { $wgProfiler = new Profiler(); } else { -- 2.20.1